import http from "@/service/request";
import type { params } from "../type";

enum API {
  // 获取用户订单信息
  GET_USER_ORDER = "/api/shop/order",
  //充钱!
  RECHARGE = "/api/shop/user/recharge",
  //上传文件
  UPLOAD_FILE = "/api/shop/update",
}

export function api_get_user_order(params: params) {
  return http({
    method: "GET",
    url: API.GET_USER_ORDER,
    params,
  });
}

export function api_recharge(data: data) {
  return http({
    method: "POST",
    url: API.RECHARGE,
    data,
  });
}

export function api_upload_file(data: file) {
  return http({
    method: "POST",
    url: API.UPLOAD_FILE,
    data,
  });
}

interface data {
  money: number;
}

interface file {
  file: File;
  type: number;
}
